public class Test {
    public static int Func1(String str){
        int sum  = 0;
        for (int i = 0; i < str.length(); i++) {
            int t = str.charAt(i)-'0';
            sum = sum*10+t;
        }
        return  sum;
    }
    public static void main(String[] args) {
        String str ="1234";
        System.out.println(Func1(str));
    }
}
